package com.kaaction.modules.mer.api;

import java.io.UnsupportedEncodingException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.dom4j.DocumentException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.kaaction.common.web.BaseController;
import com.kaaction.modules.mer.entity.SmallReport;
import com.kaaction.modules.mer.service.SmallReportService;

@Controller
@RequestMapping(value = "/api/v1/smallReportApi")
public class SmallReportApiController extends BaseController{

	@Autowired
	SmallReportService smallReportService;
	
	/**
	 * 新增小报告
	 * 
	 * @param request
	 * @param response
	 * @throws UnsupportedEncodingException
	 * @throws DocumentException
	 */
	@RequestMapping(value = "/addSmallReport")
	public void spuClassify(HttpServletRequest request, HttpServletResponse response)
			throws UnsupportedEncodingException, DocumentException {
		
		SmallReport smallReport = new SmallReport();
		
		String name = request.getParameter("name");
		String mobile = request.getParameter("mobile");
		String content = request.getParameter("content");
		
		smallReport.setName(name);
		smallReport.setMobile(mobile);
		smallReport.setContent(content);
		smallReportService.insSmallReport(smallReport);
		super.writeAjaxResponse(response,"");
	}
}
